package com.yuqiao.read.jvm;

/**
 * 栈溢出
 * -Xss128k
 */
public class JavaVMStackSoF {
    private int stackLength = 1;

    public void stackLeak() {
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) {
        JavaVMStackSoF j = new JavaVMStackSoF();
        try {
            j.stackLeak();

        } catch (Exception e) {
            System.out.println("stackLenght = [" + j.stackLength + "]");
            throw  e;
        }
    }
}
